<!--博客顶部加载条JS-->
<script type="text/javascript">$("#page_loading_in").animate({width:"60%"});</script>
<!--博客顶部加载条JS END-->
<div id="sidebar">

	<div class="sns">	<!--添加自己的相应链接-->
		<a class="sns_rss" href=" " target="_blank" title="订阅博客"></a>
		<a href=" " target="_blank" rel="nofollow" class="sns_sina"title="我的微博"></a>
		<a href=" " target="_blank" rel="nofollow" class="sns_zfb" title="向我捐助"></a>
		<a href=" " target="_blank" rel="nofollow" class="sns_db" title="我的豆瓣"></a>
		<a href=" " target="_blank" rel="nofollow" class="sns_g" title="秘密你都看"></a>
	</div>		
	<div id="sidebar-fix">			
		<ul id="sidebar-nav" class="clear">
			<li class="selected"><a href="#"><span>最近</span>更<span>新</span></a></li>
			<li><a href="#"><span>最新</span>评<span>论</span></a></li>
			<li><a href="#">热<span>门文章</span></a></li>
			<li><a href="#">随<span>机文章</span></a></li>
			<li><a href="#"><span>热门标</span>签</a></li>
			
		</ul>
		<ul id="sidebar-tab">
			<li class="tab selected">
				<?php LastUpdated_Plugin::lastUpdated();?>
			</li>
			<li class="tab">
				<div class="widget">
					<ul class="clear">
						<?php $this->widget('Widget_Comments_Recent','ignoreAuthor=true')->to($comments); ?>
						<?php while($comments->next()): ?>
							<li class="rc clear"><?php $comments->gravatar('32',''); ?><div class="rc-text"><a title="<?php $comments->title(); ?>" href="<?php $comments->permalink(); ?>"><?php $comments->excerpt(54, '...'); ?></a></div><div class="rc-link">By&nbsp;<?php echo $comments->author; ?>&nbsp;&nbsp;<?php echo timesince($comments->created);?></div></li>
						<?php endwhile; ?>
					</ul>
				</div>
			</li>
			<li class="tab">
				<div class="widget"><?php theme_most_commented_posts();?></div>
			</li>
			<li class="tab">
				<div class="widget"><?php theme_random_posts();?></div>
			</li>
			<li class="tab">
				<div class="widget">
				<ul class="tagcloud">
				<?php $this->widget('Widget_Metas_Tag_Cloud', array('sort' => 'count', 'ignoreZeroCount' => true, 'desc' => true, 'limit' => 28))->to($tags); ?>  
				<?php while($tags->next()): ?>  
				<a rel="tag" href="<?php $tags->permalink(); ?>"><?php $tags->name(); ?></a>
				<?php endwhile; ?>
				</ul>
				</div>
			</li>
		</ul>
	</div>
	<div class="clear"></div>
	<div class="sidebarlinks">
		<h4>==✿=BlogLinks=✿==</h4>
		<ul class="weblinks">
			<li><a href="http://mufeng.me/" target="_blank">牧风</a></li>
			<li><a href="http://dearroy.com/" target="_blank">罗伊</a></li>
			<li><a href="http://www.lsanday.com/" target="_blank">落森博客</a></li>
			<li><a href="http://www.feiyan.info/" target="_blank">飞晏博客</a></li>
			<li><a href="http://blog.yefengs.com/" target="_blank">夜枫忆栈</a></li>
			<li><a href="http://www.baodaobulao.com/" target="_blank">瑞士军刀背包</a></li>
			<li><a href="http://www.fengxiaozheng.com/" target="_blank">登山鞋</a></li>
			<li><a href="http://www.youaixiaojia.com/" target="_blank">旅行包</a></li>
		</ul>
	</div>
	<div class="clear"></div>		
	<div class="sidebarreader">
		<h4>==✿=读者墙=✿==</h4>	
		<?php
		$period = time() - 2592000; // 時段: 30 天, 單位: 秒
		$counts = Typecho_Db::get()->fetchAll(Typecho_Db::get()
		->select('COUNT(author) AS cnt','author', 'url', 'mail')
		->from('table.comments')
		->where('created > ?', $period )
		->where('status = ?', 'approved')
		->where('type = ?', 'comment')
		->where('authorId = ?', '0')
		->group('author')
		->order('cnt', Typecho_Db::SORT_DESC)
		->limit(15)
		);
		$mostactive = '';
		$avatar_path = Helper::options()->siteUrl . 'usr/uploads/avatarCache/';
		foreach ($counts as $count) {
		  $avatar = $avatar_path . md5(strtolower($count['mail'])) . '.jpg';
		  $c_url = $count['url']; if ( !$c_url ) $c_url = Helper::options()->siteUrl;
		  $mostactive .= "<a href='" . $c_url . "' title='" . $count['author'] . "-" . $count['cnt'] . "条评论'><img src='" . $avatar . "' alt='' class='avatar'/></a>\n";
		}
		echo $mostactive; ?>		
	</div>
	<div class="clear"></div>		
	<div id="sidebar-fixed">
		<div class="sidebarads">
		<h4>==✿=友情推介=✿==</h4>
		<a href="http://my.paulhost.com/aff.php?aff=190" title="本博客由保罗主机强力驱动" target="_blank"><img  src="http://www.cgrabbit.info/blog/usr/themes/Tnight1.1.0/images/paulhost.png"/></a>
		</div>
	</div>
</div>
<script type="text/javascript">$("#page_loading_in").animate({width:"80%"});</script>
